Version control integration


WinMerge provides optional, basic integration with some version control system (VCS) tools. By default, WinMerge is not integrated with any version control system. You can configure VCS integration both during and after installing WinMerge:

If the WinMerge installer detects whether TortoiseSVN, TortoiseCVS, or Rational ClearCase are present on your system, the Setup Additional Tasks page contains options to enable any of the WinMerge integrations.

After installation, you can open the Options dialog and configure either the ClearCase or Visual SourceSafe integration, as described in Version Control options.

[Note] Note

Only the ClearCase integration can be configured using both methods. You can configure TortoiseSVN and TortoiseCVS only during installation; conversely, you can configure Visual SourceSafe (which is not detected by the installer) only in the Options dialog.

Each WinMerge version control integration has one of these basic types of interaction:

WinMerge launches VCS file checkout

With version control systems that lock files (ClearCase and Visual Source Safe), WinMerge opens the VCS's checkout dialog before saving a file. It is up to you to check out the file, and then to check in the file later using the version control system's tools. WinMerge does not provide checkin or history tools.

VCS use WinMerge as its diff tool

When you start a diff operation using TortoiseSVN and TortoiseCVS, the integration opens WinMerge instead of the native VCS diff utility.

Example 1. TortoiseSVN integration

TortoiseSVN is a Windows client for Subversion (SVN), an open source version control system. TortoiseSVN provides its own diff utility. The WinMerge integration with this VCS enables you to use WinMerge to compare files instead of the TortoiseSVN diff tool.

One of the main uses of TortoiseSVN's diff is to see the most recent changes to a file that is under version control: that is, a file that you have checked out into a working copy. The following procedure illustrates such an operation using the WinMerge integration with TortoiseSVN. The integration with TortoiseCVS is similar.

  1. In Windows Explorer, navigate to a Subversion working copy that you have checked out.

  2. Right-click a file that is under Subversion management (usually indicated by a distinct TortoiseSVN icon), and click TortoiseSVN in the context menu.

    • If the file has not been modified, the context menu contains the shortcut, Diff with previous version. This command compares the checked-out version of the file with the previous version that was checked in to the repository.

    • If you have modified the file, the context menu contains the same Diff with previous version shortcut, plus the Diff shortcut. This command compares your revision to the current version (the one you checked out). It is useful for reviewing the changes you have made.

  3. Choose either the Diff with previous version or Diff shortcut. The WinMerge window opens, with the target file versions loaded In the File Compare window.

The TortoiseSVNDiff shortcut is available for comparing any two files in your file system, not just files that are managed by Subversion. To illustrate how the WinMerge integration works in this case:

  1. In Windows explorer, hold Ctrl, select any two files, and right-click.

  2. Choose TortoiseSVNDiff in the context menu.

    The WinMerge window opens, with the selected files loaded In the File Compare window.


Example 2. Visual Source Safe integration

This example demonstrates the file checkout type of VCS integration.

  1. Launch a WinMerge file or folder comparison whose left or right target is under version control

  2. In WinMerge, edit a version-controlled file

  3. Save your changes. WinMerge detects that the file is read-only, and assumes that it is under Visual Source Safe version control. WinMerge opens a Visual Source Save dialog, like this:

  4. In the Database dropdown list, choose the correct Visual SourceSafe database if there is more than one on your system.

  5. The Project field shows the selected file's location relative to the Visual SourceSafe database path. Verify that the path is correct: most errors are caused by the wrong project path. If you change folders, remember to change the project path, too!

  6. Enter your password if required. WinMerge remembers your password for the current session, but for your security does not store it. Therefore, you don't need to retype the password during a session, but you must retype the password each time you open WinMerge.

  7. Optionally, enable one or both of these options:

    • Link to Destination VSS project

    • Apply to all items. This option enables you to check out multiple files in a single directory when you copy files in a folder compare operation.

Unfortunately, VSS provides very little information about error conditions beyond the fact that they occurr. If an operation fails, causes might include any of the following conditions:

  • Another user might have the file checked out with exclusive access.

  • You might have specified the wrong project.

  • You might have entered the project name incorrectly.

  • You might not have used a valid VSS path (for example, this is incorrect: $/MyProject/res).

  • Your connection to the VSS server computer might be broken.